package org.pupil.proxy;

import org.pupil.common.constants.RpcProxy;
import org.pupil.spi.ExtensionLoader;

import java.io.IOException;
/**
 * @Description: 代理层抽象工厂
 * @Author: pupil
 * @Date: 2024/07/10 下午 4:26
 */
public class ProxyFactory {

    public static IProxy get(RpcProxy rpcProxy){
        return ExtensionLoader.getInstance().get(rpcProxy.name());
    }

    public static void init() throws IOException, ClassNotFoundException {
        ExtensionLoader.getInstance().loadExtension(IProxy.class);
    }
}
